#include "DynamicArray.h"

template <typename T>
void DynamicArray<T>::InsertTail(const T &element)
{
    if(size >= capacity)
    {
        capacity *= 2;
        T *newA = new T[capacity];
        for(int i = 0; i < size; i++)
        {
            newA[i] = a[i];
        }
        delete a;
        a = newA;
    }
    a[size++] = element;
}